package cj.web.tel.service;
/*
 *  
 *  
*/
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cj.web.tel.dao.GroupPeopleDAO;
import cj.web.tel.domain.GroupPeople;

/**
 * 
 * @author 
 *
 */
@Service
public class GroupPeopleService{

	@Autowired
    private GroupPeopleDAO groupPeopleDAO;
	
	/**
	 * 查询
	 * @param groupPeople
	 * @return groupPeoplelis;size
	 */
	public Map queryPeopleGl(GroupPeople groupPeople){
		Map rep = new HashMap();
		List<GroupPeople> groupPeoplelis = groupPeopleDAO.queryPeopleGl(groupPeople);
		int size = groupPeopleDAO.queryPeopleGlSize(groupPeople); 
		rep.put("groupPeoplelis", groupPeoplelis);
		rep.put("size", size);
		return rep;
    }
	
	/**
	 * 查询
	 * @param groupPeople
	 * @return groupPeoplelis;size
	 */
	public Map queryGl(GroupPeople groupPeople){
		Map rep = new HashMap();
		List<GroupPeople> groupPeoplelis = groupPeopleDAO.queryGl(groupPeople);
		int size = groupPeopleDAO.queryGlSize(groupPeople); 
		rep.put("groupPeoplelis", groupPeoplelis);
		rep.put("size", size);
		return rep;
    }
	
	/**
	 * 查询
	 * @param groupPeople
	 * @return groupPeoplelis;size
	 */
	public Map query(GroupPeople groupPeople){
		Map rep = new HashMap();
		List<GroupPeople> groupPeoplelis = groupPeopleDAO.query(groupPeople);
		int size = groupPeopleDAO.querySize(groupPeople); 
		rep.put("groupPeoplelis", groupPeoplelis);
		rep.put("size", size);
		return rep;
    }
	
	public GroupPeople queryById(int id){
		GroupPeople obj = groupPeopleDAO.queryById(id);
		return obj;
    }
	
	public void create(GroupPeople groupPeople){
		groupPeopleDAO.create(groupPeople);
	}
	
	public void update(GroupPeople groupPeople){
		groupPeopleDAO.update(groupPeople);
	}
	
	public void update(int groupId,int officeId,int depId,String location,int id){
		groupPeopleDAO.update(groupId, officeId, depId, location, id);
	}
	
	public void deleteById(int id){
		groupPeopleDAO.deleteById(id);
	}
}